<div id="sidebar">

	<ul>

		<li class="section_header"><? if(pageid == "trashheap") { echo "TrashHeap"; } else { echo ucwords(pageid); } ?></li>

<?
	if(pageid == "base") {
		if(function_exists(drizzo_trash_count)/* && (drizzo_trash_count() > 0)*/) {
			echo "<li><a href=\"trashheap.php\" title=\"View the TrashHeap\">TrashHeap (" . drizzo_trash_count() . ")</a></li>";
		}
	}

		if(pageid == "blog") {
?>
		<li<? if(!$_GET) { echo " class=\"current\""; }?>><a href="blog.php">View Current Posts</a></li>

		<li<? if($_GET['action'] == "new") { echo " class=\"current\""; }?>><a href="blog.php?action=new">Write New Post</a></li>

		<li<? if($_GET['action'] == "view_drafts") { echo " class=\"current\""; }?>><a href="blog.php?action=view_drafts">Work on Drafts (<? echo drizzo_drafts_count("blog,aside"); ?>)</a></li>
<?
		}
	
	if(pageid == "pages") {
?>
	<li<? if(!$_GET) { echo " class=\"current\""; }?>><a href="pages.php" title="View All Pages">View All Pages</a></li>

	<li<? if($_GET['action'] == "new") { echo " class=\"current\""; }?>><a href="pages.php?action=new">Write New Page</a></li>
	
	<li<? if($_GET['action'] == "view_drafts") { echo " class=\"current\""; }?>><a href="pages.php?action=view_drafts">Work on Drafts (<? echo drizzo_drafts_count("page"); ?>)</a></li>
<?
	}
	
	if(pageid == "comments") {
?>
	<li<? if(!$_GET['action']) { echo " class=\"current\""; } ?>><a href="comments.php">View Recent Comments</a></li>
	
	<li<?if($_GET['action'] == 'view_approved') { echo " class=\"current\""; }?>><a href="comments.php?action=view_approved">Approved Comments (<? echo drizzo_comments_count('approved'); ?>)</a></li>

	<li<?if($_GET['action'] == 'view_moderated') { echo " class=\"current\""; }?>><a href="comments.php?action=view_moderated">Moderated Comments (<? echo drizzo_comments_count('moderated'); ?>)</a></li>

	<li<?if($_GET['action'] == 'view_spam') { echo " class=\"current\""; }?>><a href="comments.php?action=view_spam">Spam Comments (<? echo drizzo_comments_count('spam'); ?>)</a></li>

	<li<?if($_GET['action'] == 'view_all') { echo " class=\"current\""; }?>><a href="comments.php?action=view_all">All Comments (<? echo drizzo_comments_count('all'); ?>)</a></li>
<?
	}
	
	if(pageid == "trashheap") {
?>
	<li class="current"><a href="trashheap.php" title="View the TrashHeap">View the TrashHeap</a></li>
<?
	}
?>
		<br class="clear" />

	</ul>
	
</div>